# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=sockstat
pkgver=0.4.1
pkgrel=1
groups=('blackarch' 'blackarch-networking')
pkgdesc='A tool to let you view information about open connections. It is similar to the tool of the same name that is included in FreeBSD, trying to faithfully reproduce as much functionality as is possible.'
url='https://packages.debian.org/unstable/main/sockstat'
license=('unknown')
arch=('x86_64' 'aarch64')
source=("http://ftp.de.debian.org/debian/pool/main/s/$pkgname/${pkgname}_${pkgver}.orig.tar.gz"
        'sockstat_char_bit_fix.patch')
sha512sums=('e9110232d563165d869b1a36432b865502e2109e7137ee629667ee1dd164fde3c39d05ba8edf89021ad4a04b0a210e8f922225954bf0dff454d922e9ab8a7a26'
            'd03078fec21ac15b631257711a8614dcd3192b9ca4e98de8363cce3b334a3703572084c59162fa60ffb7194fa24848c1a1a09c9cd19dad8bcbc818cf62fc3343')

build() {
  cd "$pkgname-$pkgver"

  make
}

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -aR $pkgname "$pkgdir/usr/share/$pkgname/"

  ln -s "/usr/share/$pkgname/$pkgname" "$pkgdir/usr/bin/"
}

